//START build 15-06-13 10:35:12
//start
var lib=(function(){
var PLAYER=function(){}
	PLAYER.fn             = PLAYER.prototype;
 	PLAYER.fn.constructor = PLAYER;		
	window.TOOLS          = PLAYER;
			
})()
TOOLS.getCoordinates = function( e , id ){
    x = e.clientX;
    y = e.clientY;
    document.getElementById(id).innerHTML="Coordinates: (" + x + "," + y + ")";
}
TOOLS.appendJs=function(srcJs,end){	
    var head=document.getElementsByTagName('head')[0];
    var script=document.createElement("script"); 
    script.setAttribute("type","text/javascript"); 
    script.setAttribute("src",srcJs);// 在这里引入了a.js 
	if(!end){
        head.insertBefore(script,head.childNodes[0]); 
	}else{
	    head.appendChild(script);	
	}
}
TOOLS.require=function(srcJs){
    document.write('<script src="'+srcJs+'" type="text/javascript"></script>')	
}

//true 的触发顺序总是在 false 之前；
//如果多个均为 true，则外层的触发先于内层；
//如果多个均为 false，则内层的触发先于外层。

TOOLS.ready=function(callback){
	if(document.addEventListener){
		document.addEventListener(
		    "DOMContentLoaded",
		    function(){
			   // document.removeEventListener("DOMContentLoaded",arguments.callee,false);
			    callback();
				console.log('removeEventListener');
				console.log(arguments.callee)
				
		    },
			false
		);
	}else if(document.attachEvent){
		document.attachEvent(
		    "onreadystatechange",
		    function(){
			    if ( document.readyState === "complete" ) {
				    document.detachEvent( "onreadystatechange", arguments.callee );
				    callback();
					console.log('detachEvent');
					//alert(arguments.callee)
			    }
		    }
		)
	 }
}
TOOLS.mkDiv=function(id,cssText,innerHTML,bl){
   var innerHTML =innerHTML || "";
   var body=document.getElementsByTagName('body')[0];
   var div = document.createElement("div");
   
   if(! bl ){
      div.id=id; 
   }
   div.className=id;
   div.innerHTML=innerHTML;
   div.style.cssText=cssText;
   body.insertBefore(div,body.childNodes[0]);	
}
//end
//javascript
 

TOOLS.removeChild=function(father,childs  ){	
    if(typeof childs=="undefined"){
		childs=father;
		for(i=0;i<childs.length;i++){
		    childs[i].parentNode.removeChild( childs[i] )	
		}
	   return;	
	}
    for(i=0;i<childs.length;i++){
		try{ 	
	    father.removeChild( childs[i] );
		}catch(e){
		     childs[i].parentNode.removeChild( childs[i] )	
		}
	}
}

 
/********************************************/

 /*window.TOOLS.Cretry=function(condition,fn,waitTime){
    this.doCount = 0 ;
	this.waitTime =waitTime ;
	this.fn = fn;
	this.ok =false;
	if(condition){
		try{
		this.ok =true;
	    fn();	
		
		}catch(e){
		this.doCount++;
		this.ok =false;
		window.setTimeout(fn,waitTime);
		console.warn('错误次数:'+this.doCount+'出错即将重试！');	
	 
		console.warn(fn+'重试ed');		
		}
	}else{
		console.warn('错误次数:'+this.doCount+'条件不符即将重试fn！');	
		console.warn(fn+'重试ed');	
	     window.setTimeout(fn,waitTime);
		 console.warn(fn+'重试了');	
	}
	return this;
} */
/********************************************/
TOOLS.ajax=function(url, opts){
   var xhr;
   if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xhr=new XMLHttpRequest();
  }
  else
  {// code for IE6, IE5
  xhr=new ActiveXObject("Microsoft.XMLHTTP");
  }
    
    xhr.onreadystatechange = function(){
        var completed = 4;
        if(xhr.readyState === completed){
            if(xhr.status === 200){
                opts.success(xhr.responseText, xhr);
            }else{
                opts.error(xhr.responseText, xhr);
            }
        }
    };
    xhr.open(opts.method, url, true);
    xhr.send(opts.data);
 
}
/********************************************/
//bind start
TOOLS.bind=function(scope){
	console.log('this')
	console.log(this)
	console.log('scope')
	console.log(scope)
    var fn = this;
    return function () {
        return fn.apply(scope);
    };
	
}

Function.prototype.__$bind$__ = function(){ 
//此句中的arguments指的是 __bind__函数的参数

  var fn = this, args = Array.prototype.slice.call(arguments), object = args.shift(); 
  
  return function(){ 
   //alert(Array.prototype.slice.call(arguments))
    return fn.apply(object, 
	/*此句中的arguments指的是 函数fn的参数*/
	
      args.concat(Array.prototype.slice.call(arguments))); 
  }; 
}
;
Function.prototype.__$basebind$__ = function(scope){ 
    var fn = this;
    return function () {
        return fn.apply(scope);
    };
}
;
Function.__$proto$__=Function.prototype.__$proto$__={
	
	__$proto$__:{},
	__a__:function(){},
	__b__:function(){},
	__c__:function(){}
	
	};
//Function.__$proto$__.__$proto$__=Function.prototype;
//bind end
/********************************************/
TOOLS.class=function(tagName,className) //获得标签名为tagName,类名className的元素
{
    if(document.getElementsByClassName) //支持这个函数
    {        return document.getElementsByClassName(className);
    }
    else
    {       var tags=document.getElementsByTagName(tagName);//获取标签
        var tagArr=[];//用于返回类名为className的元素
        for(var i=0;i < tags.length; i++)
        {
            if(tags[i].class == className)
            {
                tagArr[tagArr.length] = tags[i];//保存满足条件的元素
            }
        }
        return tagArr;
    }

}

function toggle(elements){
	if(elements[0].style.display!='none'){
	    var displayValue = 'none';	
	}else{
		var displayValue = 'block';
	}
	for(var i=0;i < elements.length; i++)
    {
        elements[i].style.display=displayValue;        
    }	
}
/********************************************/

//相对于文档
TOOLS.getMousePagePos=function (event) {
    var e = event || window.event ||  arguments.callee.caller.arguments[0]/*支持火狐*/ ;
    var scrollX = document.documentElement.scrollLeft
        || document.body.scrollLeft;
    var scrollY = document.documentElement.scrollTop
        || document.body.scrollTop;

    var x = e.pageX || e.clientX + scrollX;
    var y = e.pageY || e.clientY + scrollY;

    return [x,y];
}

//相对屏幕
TOOLS.getMouseScreenPos=function (event) {
    var e = event || window.event   ||  arguments.callee.caller.arguments[0];
    return [e.screenX,e.screenY]
}

//相对相对浏览器窗口
TOOLS.getMouseClientPos=function (event) {
    var e = event || window.event  ||  arguments.callee.caller.arguments[0];
    return [e.clientX,e.clientY]
}
TOOLS.Cevent=function(){}
TOOLS.Cevent.getAsc=function(ev){	
 	 
    TOOLS.Cevent.Asc = '['+String.fromCharCode( ev.keyCode )
	+':'+ ev.keyCode+']';
	TOOLS.Cevent.eventCode = ev.keyCode;
	return TOOLS.Cevent.Asc;	
}
TOOLS.Cevent.Asc ='';
/********************************************/
TOOLS.include=function (url){
  var element;
 switch(url.split(".").pop()){
   case "css":{
     element=document.createElement("link");
     element.setAttribute("rel","stylesheet");
     element.setAttribute("type","text/css")
     element.setAttribute("href",url+"?r="+Math.random()+""+Math.random())
   }break;
   case "js":{
     element=document.createElement("script");
     element.setAttribute("language","javascript")
     element.setAttribute("src",url+"?r="+Math.random()+""+Math.random()  )
   }break;
   default:window.console && window.console.error("could not identify（不能识别）[",url,"]skip include（跳过包含）");return;
 }
 var head=document.querySelector("head");
 if(head.innerHTML.indexOf(element.outerHTML)!=-1){
   window.console && window.console.warn("Duplicate(重复) include（包含）, skipping:",url);
 }else{
   head.appendChild(element);
 }
}
/********************************************/
/*function CArray(){}
CArray.constructor=CArray;
CArray.prototype=new Array()*/
//把数组再clone一份
Array.prototype.__$clone$__=function(){
    var ret=new Array();

    
    for(i=0,  len=this.length ; i<len ; i++){        
        ret[i]=this[i]
    }
    //console.log('ret->');
    //console.log(ret);
    //console.log('<-ret');
    return ret;    
}

//随机打乱数组
Array.prototype.__$shuffle$__=function(){
    //clone的一份数组
   /* var arr=new Array();
    for(i=0,  len=this.length ; i<len ; i++){        
        arr[i]=this[i]
    }*/
    var arr=this.__$clone$__()
    
    //要返回的数组     
    var retarr=new Array();         
    for($i=0 ,len=arr.length ;$i<len;$i++){ 
    //ele取出的一个数组元素，此数组的长度是1
        var ele=arr.splice(       
        Math.round(  Math.random()*( arr.length-1 - 0) + 0  )
         ,1  );     
        retarr[$i]=ele[0];
    }
    
    return retarr;
 
}

/*
splice() 方法向/从数组中添加/删除项目，然后返回被删除的项目。
注释：该方法会改变原始数组。
语法
arrayObject.splice(index,howmany,item1,.....,itemX)
参数	描述
index	必需。整数，规定添加/删除项目的位置，使用负数可从数组结尾处规定位置。
howmany	必需。要删除的项目数量。如果设置为 0，则不会删除项目。
item1, ..., itemX	可选。向数组添加的新项目。
返回值
类型	描述
Array	包含被删除项目的新数组，如果有的话。
说明
splice() 方法可删除从 index 处开始的零个或多个元素，并且用参数列表中声明的一个或多个值来替换那些被删除的元素。
如果从 arrayObject 中删除了元素，则返回的是含有被删除的元素的数组。
技术细

节*/
Array.prototype.__$rdel$__=function(){
    if(this.length!==0){
     this.splice(       
        Math.round(  Math.random()*( this.length-1 - 0) + 0  )
         ,1  );    
    }
}

//从数组中随机选择一个元素 ，并将那个元素删除，如果没有元素则copy一个数组到数组中
Array.prototype.__$rselect$__=function(arr){
    
    if(this.length==0){
         for(var i=0,  len=arr.length ; i<len ; i++){        
           this[i]=arr[i]
		 }     
    }
	 var that=this;
    if(that.length!==0){
     return that.splice(       
        Math.round(  Math.random()*( that.length-1 - 0) + 0  )
         ,1  );    
    } 
}

Array.prototype.__$rselect2$__=function(arr){
    return    this[ Math.round(  Math.random()*( this.length-1 - 0) + 0  ) ];
}

Array.prototype.a=function(){
    
    console.log(this)
    console.log(this.length)
    }
    
    //打印一维数组
Array.prototype.__$printR1$__=function (){
    ret='Array( '
   for (i=0;i<this.length;i++){
       ret+='['+i+']=>'+ showobj(this[i])+',<br>'
    }
    ret+=' )';
    return ret;
}

function showobj(o){
	if(typeof o == 'object'){
	    return o.s +'|' + o.e +'|' + o.lyric;
		
	}	
}

Array.prototype.__$inArray$__=function(str){
    var ret = false;
    for(i=0,  len=this.length ; i<len ; i++){        
       if(str===this[i]){
		   return true;   
	   }
    }
	return ret;
    
}
//顺序选择 __$sequentialSelection$__
Array.prototype.__$sequSe$__=function( ){
   
    
	if(typeof this.curr ==='undefined'
	|| this.curr>this.length-1
	){
	    this.curr=0;	
	}
	 this.curr ++ ; 
	ret = this[this.curr];
	
	return ret;
    
}

//顺序选择 __$sequentialSelection$__
Array.prototype.__$sequSeUp$__=function( ){
   
    
	if(typeof this.curr ==='undefined'
	|| this.curr<=1
 
	){
	    this.curr=this.length;	
	}
	 this.curr -- ; 
	ret = this[this.curr];
	return ret;
    
}
Array.prototype.__$setCurrent$__=function( i ){
	
	this.curr = i ;
	
    if( this.curr<0
	|| this.curr>=this.length-1
	){
	    this.curr=0;	
	}
	  
	ret = this[this.curr];
	return ret;

}

/********************************************/
;
function Ctrace(style_top){
	//盒子的id
    this.boxid=Ctrace.mkId('_BOX');	
	//计录所有trace层的id
	this.traceid=new Array();
	if(typeof style_top ==='undefined' ){
	    this.style_top = 'top:0px;';
	}else{
		this.style_top=style_top;
	}
	
	this.mkBox()
	this.traceBgColor = '#f60'
	this.traceFontSize = 48 ;
	this.currentTID = false ;
	//计算count的次数 
	this.count = 0;
	this.timeoutStep = 800;
	this.timeoutTime = 0;
	this.isKillTrace = true ;
	this.tTimeOut=4000;
	
}
//生成一个碓一的随机id
Ctrace.mkId=function(s){
	if(typeof s === 'undefined'){
	    s = '';	
	}
 return 'ID_' + (new Date()).getTime() +'_'
        +    Math.round(  Math.random()*( 999999-1 - 100000) + 100000  )
		+    Math.round(  Math.random()*( 999999-1 - 100000) + 100000  )
		+s ;	
}

//创建trace层
Ctrace.prototype.mkTraceDiv=function(msg,id,boxid,traceBgColor,size,isRemove){
 var oDiv = document.createElement('div');
    oDiv.innerHTML = msg;
    oDiv.id = id;
    oDiv.style.cssText = 'z-index:99;color:#fff; background-color:'+traceBgColor+';'
        + 'width:'+(window.innerWidth  )+'px;' +' font-size:'+size+'px;margin-bottom:5px;'
        +' border-radius: 5px;filter: alpha(opacity = 80);opacity: 0.8; margin:0px;';
	oDiv.setAttribute('onDblClick','this.style.display="none"')
    document.getElementById( boxid ).appendChild(oDiv)
	if(this.isKillTrace){
		if(isRemove){
			console.log(this.currentTID);
	   window.setTimeout((function(){oDiv.parentNode.removeChild(oDiv ); this.currentTID = false;
		 
			}).__$bind$__(this),this.tTimeOut)	
		}else{
		window.setTimeout((function(){oDiv.parentNode.removeChild(oDiv ); this.currentTID = false;
			}).__$bind$__(this),this.tTimeOut)	
		}
	}else{
		
	}
}

//创建一个盒子，用来装 trace层
Ctrace.prototype.mkBox=function(){
   // if ( ! document.getElementById(this.boxid)) {
		//创建一装弹出杠的盒子，
		//如果创建了就不再创建
        var box = document.createElement('div')
        box.id = this.boxid;
		box.setAttribute('style',"position:fixed;z-index:90;width:"+window.innerWidth+'px;'+this.style_top)
       // box.style.cssText = 'position:fixed;z-index:99;top:0px;'
        window.document.getElementsByTagName('body')[0].appendChild(box)
   // }	
}

Ctrace.prototype.trace=function (msg,traceBgColor , fontsize,isRemove) {
	 var bgc;
     if(typeof traceBgColor === 'undefined' || ''=== traceBgColor){
	    bgc = this.traceBgColor 	 
	 }else{
	    bgc =  traceBgColor 
	 }
	 
	  var size;
     if(typeof fontsize === 'undefined' ){
	    size = this.traceFontSize 	 
	 }else{
	    size =  fontsize 
	 }
	 if(typeof isRemove === 'undefined' ){
	    isRemove = true 	 
	 }else{
	    isRemove =  false 
	 }
	 
	//创建一个弹出框
	var oDivid=Ctrace.mkId('_Trace');
	this.traceid.push(oDivid);	
	this.currentTID = oDivid
	
	this.mkTraceDiv(msg,oDivid ,this.boxid,bgc ,size,isRemove)	
	window.addEventListener('resize',function(){	
	       //console.warn( document.getElementById(oDivid));
		   if(document.getElementById(oDivid)){	
		    document.getElementById(oDivid).style.width = (window.innerWidth )+'px';	
		   }
		} , false)
}

Ctrace.prototype.traceOne=function(msg,isSetTimeOut){
	
	if(this.currentTID === false){
	    this.trace(msg,this.traceBgColor,this.traceFontSize,false)	
		 
	}
	
	if(typeof isSetTimeOut === 'undefined'){
	    isSetTimeOut = true;	
	}
	this.count++;
	this.timeoutTime += this.timeoutStep 
	var _count =  this.count
	if(this.isKillTrace && this.currentTID !== false){
	    var _currentTID = this.currentTID
	}
	 if(isSetTimeOut && this.isKillTrace){
		 
		try{ 
	        window.setTimeout(function(){
	        document.getElementById(_currentTID).innerHTML=_count+'.'+msg;	
		    } ,this.timeoutTime)//this.count*this.timeoutStep	 
		 }catch(e){
		this.currentTID=false;
		this.traceOne (msg,isSetTimeOut)	 
		 }
		
	 }else{
		 try{
	    document.getElementById(this.currentTID).innerHTML=this.count+'.'+msg;
		 }catch(e){
		//this.currentTID=false;
		    this.traceOne (msg,isSetTimeOut)	 
		 }
	 }
	
}
Ctrace.prototype.step=function(time){
    this.timeoutStep =time;	
}
/********************************************/
;
function CtraceForSubTitle(){
	//盒子的id
    this.boxid=CtraceForSubTitle.mkId('_BOX');	
	//计录所有trace层的id
	this.traceid=new Array();
	this.mkBox()
	this.traceBgColor = '#f60'
	this.traceFontSize = 48 ;
	this.currentTID = false ;
	//计算count的次数 
	this.count = 0;
	this.timeoutStep = 800;
	this.timeoutTime = 0;
	this.isKillTrace = true ;
	this.tTimeOut=4000;
}
//生成一个碓一的随机id
CtraceForSubTitle.mkId=function(s){
	if(typeof s === 'undefined'){
	    s = '';	
	}
 return 'ID_' + (new Date()).getTime() +'_'
        +    Math.round(  Math.random()*( 999999-1 - 100000) + 100000  )
		+    Math.round(  Math.random()*( 999999-1 - 100000) + 100000  )
		+s ;	
}

//创建trace层
CtraceForSubTitle.prototype.mkTraceDiv=function(msg,id,boxid,traceBgColor,size,isRemove){
 var oDiv = document.createElement('div');
    oDiv.innerHTML = msg;
    oDiv.id = id;
    oDiv.style.cssText = 'text-align:center;z-index:50;color:#fff; background-color:'+traceBgColor+';'
         +'width:'+(window.innerWidth-12)+'px;'  +'font-size:'+size+'px;margin-bottom:5px;'
        +' border-radius: 12px;filter: alpha(opacity = 85);opacity: .85; margin:2px  0px;padding:6px;';
	oDiv.setAttribute('onDblClick','this.parentNode.removeChild( this )')
    document.getElementById( boxid ).appendChild(oDiv)
	if(this.isKillTrace){
		if(isRemove){
			console.log(this.currentTID);
	   window.setTimeout((function(){oDiv.parentNode.removeChild(oDiv ); this.currentTID = false;
		 
			}).__$bind$__(this),this.tTimeOut)	
		}else{
		window.setTimeout((function(){oDiv.parentNode.removeChild(oDiv ); this.currentTID = false;
			}).__$bind$__(this),this.tTimeOut)	
		}
	}else{
		
	}
}

//创建一个盒子，用来装 trace层
CtraceForSubTitle.prototype.mkBox=function(){
   // if ( ! document.getElementById(this.boxid)) {
		//创建一装弹出杠的盒子，
		//如果创建了就不再创建
        var box = document.createElement('div')
        box.id = this.boxid;
		box.setAttribute('style',"position:fixed;z-index:50;bottom:60px;width:"+window.innerWidth+'px;font-family:"inconsolata",ZhunYuan,微软雅黑;text-outline: 2px 2px #000;text-shadow:2px 2px 4px #000000;text-align:center;')
       // box.style.cssText = 'position:fixed;z-index:99;top:0px;'
        window.document.getElementsByTagName('body')[0].appendChild(box)
   // }	
}

CtraceForSubTitle.prototype.trace=function (msg,traceBgColor , fontsize,isRemove) {
	 var bgc;
     if(typeof traceBgColor === 'undefined' || ''=== traceBgColor){
	    bgc = this.traceBgColor 	 
	 }else{
	    bgc =  traceBgColor 
	 }
	 
	  var size;
     if(typeof fontsize === 'undefined' ){
	    size = this.traceFontSize 	 
	 }else{
	    size =  fontsize 
	 }
	 if(typeof isRemove === 'undefined' ){
	    isRemove = true 	 
	 }else{
	    isRemove =  false 
	 }
	 
	//创建一个弹出框
	var oDivid=CtraceForSubTitle.mkId('_Trace');
	this.traceid.push(oDivid);	
	this.currentTID = oDivid
	
	this.mkTraceDiv(msg,oDivid ,this.boxid,bgc ,size,isRemove)	
	window.addEventListener('resize',function(){	
	       //console.warn( document.getElementById(oDivid));
		   if(document.getElementById(oDivid)){	
		    document.getElementById(oDivid).style.width = (window.innerWidth-12)+'px';	
		   }
		} , false)
}

CtraceForSubTitle.prototype.traceOne=function(msg,isSetTimeOut){
	
	if(this.currentTID === false){
	    this.trace(msg,this.traceBgColor,this.traceFontSize,false)	
		 
	}
	
	if(typeof isSetTimeOut === 'undefined'){
	    isSetTimeOut = true;	
	}
	this.count++;
	this.timeoutTime += this.timeoutStep 
	var _count =  this.count
	if(this.isKillTrace && this.currentTID !== false){
	    var _currentTID = this.currentTID
	}
	 if(isSetTimeOut && this.isKillTrace){
		 
		try{ 
	        window.setTimeout(function(){
	        document.getElementById(_currentTID).innerHTML=this.count+'.'+msg;	
		    } ,this.timeoutTime)//this.count*this.timeoutStep	 
		 }catch(e){
		this.currentTID=false;
		this.traceOne (msg,isSetTimeOut)	 
		 }
		
	 }else{
		 try{
	    document.getElementById(this.currentTID).innerHTML=this.count+'.'+msg;
		 }catch(e){
		//this.currentTID=false;
		    this.traceOne (msg,isSetTimeOut)	 
		 }
	 }
	
}
CtraceForSubTitle.prototype.step=function(time){
    this.timeoutStep =time;	
}
/********************************************/
;(function(window){  
var	
    undefined = "undefined",
    numid=0,
    doll = function(jQ) { };
	 	
    doll.fn = doll.prototype = {
	    constructor: doll
	}
	window.doll = doll;
})(window)
/********************************************/
doll.fullscreen = function (divObj) {		
		if(typeof divObj=="undefined"){
			divObj=document.documentElement; 
			//divObj=window;
		}
        if (divObj.requestFullscreen) {			
            divObj.requestFullscreen();console.log("requestFullscreen()");
        }
        else if (divObj.msRequestFullscreen) {
            divObj.msRequestFullscreen();console.log("msRequestFullscreen()");
		}
        else if (divObj.mozRequestFullScreen) {			
            divObj.mozRequestFullScreen();console.log("mozRequestFullScreen");
        }
        else if (divObj.requestFullscreen 
		|| ('webkitRequestFullScreen' in document.documentElement) ) 
		{    
		    try{
					 //支持谷歌 对Chrome 特殊处理，
					 // 参数 Element.ALLOW_KEYBOARD_INPUT 使全屏状态中可以键盘输入。
					if ( window.navigator.userAgent.toUpperCase().indexOf( 'CHROME' ) >= 0 ) {
						 console.log("chrome浏览正在器全屏webkitRequestFullScreen( Element.ALLOW_KEYBOARD_INPUT )")
						 divObj.webkitRequestFullScreen( Element.ALLOW_KEYBOARD_INPUT );					 
						 
					}else{					
                        divObj.webkitRequestFullscreen();
						console.log("webkitRequestFullscreen()");
					}
		     }catch(e){
				 //支持 safari5.1  screen的一个大小写问题
				 divObj.webkitRequestFullScreen();
				 console.log(" safari5.1 浏览正在器全屏webkitRequestFullScreen")
				 
			 }
        }else{		     		 
			console.log("你的浏览器不支持全屏！");
		}
        //doll.inFullScreen = true;
        return;
      }
	  
	  
	  doll.exitFullscreen = function (document) {
		 var document=document||window.document;
        if (document.exitFullscreen) {
          document.exitFullscreen();
        }
        else if (document.msExitFullscreen) {
          document.msExitFullscreen();
        }
        else if (document.mozCancelFullScreen) {
          document.mozCancelFullScreen();
        }
        else if (document.webkitCancelFullScreen) {
			
          document.webkitCancelFullScreen();
        }
        //doll.inFullScreen = false;
		console.log("浏览退出全屏……");
        return;
      }	  
;	  
/********************************************/
//EListenCanvas start
if(typeof TOOLS ==="undefind"){
	var TOOLS =function(){}
	}
;(function(){
    var EListenCanvas = function(canvasid,w,h,bl){
		if(typeof w ==='undefined'){
		    w = 0 ;
			h = 0 ;	
		}
		this.type = 'resize';
		this.method = function(){
			if(typeof bl==='undefined'){
		    document.getElementById(canvasid).width  = window.innerWidth-w;
		    document.getElementById(canvasid).height = window.innerHeight-1-h;	
			console.log(document.getElementById(canvasid).width)
			}else{
			document.getElementById(canvasid).style.width  
			=parseInt(window.innerWidth*w)+'px' 
		   // document.getElementById(canvasid).style.height
		   // =parseInt(window.innerHeight*h)-1+'px'	
			console.log(document.getElementById(canvasid).style.width )					
			}
		}
		this.useCapture = false;
		this.add();		
		}  
		EListenCanvas.prototype.add=function(){
		    window.addEventListener( this.type, this.method, this.useCapture );	
			var themethod = this.method;
			EListenCanvas.ready(function(){
			   themethod()		
		    }) 
						
		}
		EListenCanvas.ready=function(callback){
	if(document.addEventListener){
		document.addEventListener(
		    "DOMContentLoaded",
		    function(){
			    document.removeEventListener("DOMContentLoaded",arguments.callee,false);
			    callback();
				console.log('-removeEventListener');
		    },
			false
		);
	}else if(document.attachEvent){
		document.attachEvent(
		    "onreadystatechange",
		    function(){
			    if ( document.readyState === "complete" ) {
				    document.detachEvent( "onreadystatechange", arguments.callee );
				    callback();
					console.log('-detachEvent');
			    }
		    }
		)
	 }
   }	
   window.EListenCanvas=TOOLS.EListenCanvas=EListenCanvas;	 
})()
//EListenCanvas end
//END
//var o={name:'koolfer'}
//var xxx=function(){
//	
//	
//	alert(this.name)
//	}.__$bind$__(o)
//	
//	xxx()
//	
/********************************************/
TOOLS.mkDivfx=function(id,cssText,innerHTML){
    var innerHTML =innerHTML || "";
    var body=document.getElementsByTagName('body')[0];
    var div = document.createElement("div");
    div.id=id;
    div.innerHTML=innerHTML;
    div.style.cssText=cssText;
    try{body.insertBefore(div,body.childNodes[0]);	}catch(e){ }
}
//


/********************************************/
window.mathExt=new Object();
mathExt.to60=function (sec){
	//转两个占位符表式 2变成02
	//to2placeholder
	 
	function to2 (n){
		return n<10 ?	0+""+n  : n  ;
	}	
	function to2ToFixed (n){
		return n<10 ?	0+""+n.toFixed(3) : n.toFixed(3) ;
	}	
	s=to2ToFixed(sec%60)
	m=to2(
		 parseInt     (sec/60) % 60   
	);
	h=to2( parseInt (
		    ( sec/(60*60) ) % 60      
	));
	return  h!=0 ? h +":"+  m +":"+   (s)   :  m  +":"+   (s)  ;  
}
;
/********************************************/
TOOLS.getLocalTime=function (timestamp,chinese){
    if (!timestamp){
		var date=new Date()
        datetime = date.toLocaleString()+":"+date.getMilliseconds();
    }else{
        datetime = new Date(parseInt(timestamp)*1000).toLocaleString();
    }
    if (!chinese){
        return datetime.replace(/年|月/g, '-').replace(/日/g, '');
    }
    return datetime;
}
/********************************************/
